﻿using CoreWCF;
using SlamDunk.MES.Domain.Mediators;
using SlamDunk.MES.IAppService.Interfaces;

namespace SlamDunk.MES.AppService.Implements
{
    /// <summary>
    /// 编号生成服务契约实现
    /// </summary>
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, IncludeExceptionDetailInFaults = true)]
    public class NumberContract : INumberContract
    {
        #region # 字段及构造器

        /// <summary>
        /// 领域服务中介者
        /// </summary>
        private readonly DomainServiceMediator _svcMediator;

        /// <summary>
        /// 依赖注入构造器
        /// </summary>
        public NumberContract(DomainServiceMediator svcMediator)
        {
            this._svcMediator = svcMediator;
        }

        #endregion

        #region # 生成库存单据编号 —— string GenerateStockOrderNo(string prefix)
        /// <summary>
        /// 生成库存单据编号
        /// </summary>
        /// <param name="prefix">前缀</param>
        /// <returns>单据编号</returns>
        public string GenerateStockOrderNo(string prefix)
        {
            return this._svcMediator.NumberSvc.GenerateStockOrderNo(prefix);
        }
        #endregion

        #region # 生成销售订单编号 —— string GenerateSaleOrderNo()
        /// <summary>
        /// 生成销售订单编号
        /// </summary>
        /// <returns>销售订单编号</returns>
        public string GenerateSaleOrderNo()
        {
            return this._svcMediator.NumberSvc.GenerateSaleOrderNo();
        }
        #endregion

        #region # 生成生产计划编号 —— string GenerateProductionPlanNo()
        /// <summary>
        /// 生成生产计划编号
        /// </summary>
        /// <returns>生产计划编号</returns>
        public string GenerateProductionPlanNo()
        {
            return this._svcMediator.NumberSvc.GenerateProductionPlanNo();
        }
        #endregion

        #region # 生成作业计划编号 —— string GenerateExecutionPlanNo()
        /// <summary>
        /// 生成作业计划编号
        /// </summary>
        /// <returns>作业计划编号</returns>
        public string GenerateExecutionPlanNo()
        {
            return this._svcMediator.NumberSvc.GenerateExecutionPlanNo();
        }
        #endregion

        #region # 生成作业计划质量检查编号 —— string GenerateExecutionPlanInspectionNo()
        /// <summary>
        /// 生成作业计划质量检查编号
        /// </summary>
        /// <returns>作业计划质量检查编号</returns>
        public string GenerateExecutionPlanInspectionNo()
        {
            return this._svcMediator.NumberSvc.GenerateExecutionPlanInspectionNo();
        }
        #endregion

        #region # 生成工单质量检查编号 —— string GenerateWorkOrderInspectionNo()
        /// <summary>
        /// 生成工单质量检查编号
        /// </summary>
        /// <returns>工单质量检查编号</returns>
        public string GenerateWorkOrderInspectionNo()
        {
            return this._svcMediator.NumberSvc.GenerateWorkOrderInspectionNo();
        }
        #endregion

        #region # 生成设备维护记录编号 —— string GenerateEquipmentMaintenanceNo()
        /// <summary>
        /// 生成设备维护记录编号
        /// </summary>
        /// <returns>设备维护记录编号</returns>
        public string GenerateEquipmentMaintenanceNo()
        {
            return this._svcMediator.NumberSvc.GenerateEquipmentMaintenanceNo();
        }
        #endregion
    }
}
